import java.util.Scanner;

//框框
public class test2 {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
        int x = scanner.nextInt();
        int[] arr = new int[n];
        for (int i = 0; i <n ; i++) {
            arr[i] = scanner.nextInt();
        }

        int l = 0;
        int r = 1001;
        int flag=Integer.MAX_VALUE;//用来计算与x相差最小的
        for (int i = 0; i < arr.length; i++) {
            int sum = arr[i];
            for (int j = i+1; j < arr.length; j++) {
                sum+=arr[j];
                if(sum>x&&(j-i)<=(r-l)){
                    if(flag-x>sum-x){
                        l=i;
                        r=j;
                    }
                    flag=sum;
                    break;
                }
            }
        }
        System.out.println(l+" "+r);
    }
}
